package com.atguigu.gmall.order.mapper;

import com.atguigu.gmall.order.entity.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author lfy
* @description 针对表【order_info(订单表 订单表)】的数据库操作Mapper
* @createDate 2022-10-18 14:57:24
* @Entity com.atguigu.gmall.order.entity.OrderInfo
*/
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {


    /**
     * 利用 CAS思想  实现 轻量级乐观锁 - 幂等性关单
     * @param expectOrderStatus    满足多种期望状态任意一种
     * @param expectProcessStatus  满足多种期望状态任意一种
     * @param orderStatus          修改成最终的状态
     * @param processStatus        修改成最终的状态
     * @param orderId
     * @param userId
     */
    void updateOrderStatusByCAS(@Param("expectOrderStatus") List<String> expectOrderStatus,
                                @Param("expectProcessStatus") List<String> expectProcessStatus,
                                @Param("orderStatus") String orderStatus,
                                @Param("processStatus") String processStatus,
                                @Param("orderId") Long orderId,
                                @Param("userId") Long userId);
}




